package com.hy.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.hy.service.TestService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: huangya
 * @Date: 2020/7/1
 * @Description:
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @DubboReference
    TestService testService;

    @NacosValue(value = "${testfield:1111}", autoRefreshed = true)
    private String testfield;

    @RequestMapping("/hello")
    public String hello(){
        return testService.hello();
    }


    @RequestMapping("/testConfig")
    public String testConfig(){
        return testfield;
    }


}
